var ctxPath = "/education";

$.getUrlParam = function (name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
};

!function ($) {
    // var phone = $.getUrlParam('phone');
    //
    // var initPaySuccess = function(phone) {
    //     $.ajax({
    //         url: ctxPath + '/wx/api/customer/buyLogin',
    //         type: 'post',
    //         dataType: 'json',
    //         data: {phone: phone},
    //         success: function (result) {
    //             if(result.returnCode == 0) {
    //                 $("#viewOrdersBtn").attr("onclick", "location.href='/education/wx/orders.html?token=" + result.token + "'");
    //                 $("#toHomeBtn").attr("onclick", "location.href='/education/wx/home.html'");
    //             } else {
    //                 alert(result.returnMsg);
    //             }
    //         }
    //     });
    // };
    //
    // initPaySuccess(phone);
    // $("#viewOrdersBtn").attr("onclick", "location.href='/education/wx/orders.html?'");
    // $("#toHomeBtn").attr("onclick", "location.href='/education/wx/home.html'");
    $("#viewOrdersBtn").click(function () {
        window.location.href="/education/wx/orders.html";
    });
    $("#toHomeBtn").click(function () {
        window.location.href="/education/wx/home.html";
    });

}(jQuery);